package jobs.job3.classloaderdemo.server;

import jobs.job3.classloaderdemo.server.zkutil.ServiceRegistrationClient;

import java.io.IOException;

// 封装计算节点，和zookeeper 的注册客户端
public class Server {
    CalculationNode calculationNode;       //计算节点
    ServiceRegistrationClient serRegCli;  // 向zookeeper注册服务地址的客户端

    public Server(String ip, int port) throws IOException {
        calculationNode = new CalculationNode(ip, port);
        serRegCli = new ServiceRegistrationClient();
        serRegCli.connectZk();
        serRegCli.saveServerInfo(ip, String.valueOf(port));
    }
}
